/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itschapala.dsw2.RegistroES.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Ricky
 */
@Entity
@Table(name = "employeet")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Employeet.findAll", query = "SELECT e FROM Employeet e"),
    @NamedQuery(name = "Employeet.findByIdEmployeeT", query = "SELECT e FROM Employeet e WHERE e.idEmployeeT = :idEmployeeT"),
    @NamedQuery(name = "Employeet.findByFirstNameR", query = "SELECT e FROM Employeet e WHERE e.firstNameR = :firstNameR"),
    @NamedQuery(name = "Employeet.findByLastNameR", query = "SELECT e FROM Employeet e WHERE e.lastNameR = :lastNameR"),
    @NamedQuery(name = "Employeet.findByAgeR", query = "SELECT e FROM Employeet e WHERE e.ageR = :ageR")})
public class Employeet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idEmployeeT")
    private Integer idEmployeeT;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "FirstNameR")
    private String firstNameR;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "LastNameR")
    private String lastNameR;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AgeR")
    private int ageR;
    @Lob
    @Size(max = 65535)
    @Column(name = "FunctionR")
    private String functionR;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEmployee")
    private List<Register2t> register2tList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idEmployee")
    private List<Register1t> register1tList;

    public Employeet() {
    }

    public Employeet(Integer idEmployeeT) {
        this.idEmployeeT = idEmployeeT;
    }

    public Employeet(Integer idEmployeeT, String firstNameR, String lastNameR, int ageR) {
        this.idEmployeeT = idEmployeeT;
        this.firstNameR = firstNameR;
        this.lastNameR = lastNameR;
        this.ageR = ageR;
    }

    public Integer getIdEmployeeT() {
        return idEmployeeT;
    }

    public void setIdEmployeeT(Integer idEmployeeT) {
        this.idEmployeeT = idEmployeeT;
    }

    public String getFirstNameR() {
        return firstNameR;
    }

    public void setFirstNameR(String firstNameR) {
        this.firstNameR = firstNameR;
    }

    public String getLastNameR() {
        return lastNameR;
    }

    public void setLastNameR(String lastNameR) {
        this.lastNameR = lastNameR;
    }

    public int getAgeR() {
        return ageR;
    }

    public void setAgeR(int ageR) {
        this.ageR = ageR;
    }

    public String getFunctionR() {
        return functionR;
    }

    public void setFunctionR(String functionR) {
        this.functionR = functionR;
    }

    @XmlTransient
    public List<Register2t> getRegister2tList() {
        return register2tList;
    }

    public void setRegister2tList(List<Register2t> register2tList) {
        this.register2tList = register2tList;
    }

    @XmlTransient
    public List<Register1t> getRegister1tList() {
        return register1tList;
    }

    public void setRegister1tList(List<Register1t> register1tList) {
        this.register1tList = register1tList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEmployeeT != null ? idEmployeeT.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Employeet)) {
            return false;
        }
        Employeet other = (Employeet) object;
        if ((this.idEmployeeT == null && other.idEmployeeT != null) || (this.idEmployeeT != null && !this.idEmployeeT.equals(other.idEmployeeT))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.itschapala.dsw2.RegistroES.modelo.Employeet[ idEmployeeT=" + idEmployeeT + " ]";
    }
    
}
